<template>
	<div class="q-pa-md">
		<q-form @submit="onSubmit" @reset="onReset" class="q-gutter-md" style="max-width: 300px">

			<q-input type="number" v-model="releaseDate" label="发放时间" />

			<q-select v-model="zzdb" :options="zz" label="选择组织" option-value="pk_org" option-label="name"/>

			<!-- <q-select v-model="model" :options="options" label="选择人员" /> -->

			<div>
				<q-btn label="全员发放" type="submit" color="negative" />
				<q-btn label="个人发放" type="reset" color="primary" flat class="q-ml-sm" />
			</div>
		</q-form>

	</div>
</template>

<script>
export default {
	data() {
		return {
			releaseDate: null,
			model: null,
			options: [],
			zz:[],
			zzdb:'',
			showDateDialog: false
		};
	},

	async mounted() {
		this.$q.loading.show();
		const date = new Date();
		var nian = date.getFullYear();
		var yue = date.getMonth() + 1;
		if(yue < 10){
			yue = "0" + yue;
		}
		this.zz=await this.$API.gz.GetAllOrgs.get();
		this.releaseDate =nian+ yue;
		this.$q.loading.hide();
	},
	methods: {
		async onSubmit() {
			// 提交表单的逻辑
			this.$q.loading.show();
			var a = await this.$API.gz.GetGZXX.get(this.releaseDate,this.zzdb.name,this.zzdb.pk_org);
			console.log(a);
			this.$q.loading.hide();
		},
		onReset() {
			// 重置表单的逻辑
		},
		closeDateDialog() {
			this.showDateDialog = false;
		}
	}
}
</script>

<style></style>
